﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Basis.Core;
using System.ComponentModel.DataAnnotations;

namespace Tanmia.Warehouse.Core
{
    /// <summary>
    /// المستودع
    /// </summary>
    public class StorageSection : BaseBusinessObject
    {
        private int storeID;
        private Section sectionType;
        private Branch branch;
        private string name;
        private string engName;
        private string abbreviation;
        private string notes;
        private StorageSection parent;

        /// <summary>
        /// رقم تعريف المستودع
        /// </summary>
        [Display(Name = "رقم المستودع: ", ShortName = "رقم المستودع", Order = 0)]
        public virtual int StorageSectionID
        {
            get { return storeID; }
            set { SetValue<int>("StorageSectionID", ref  storeID, value); }
        }

        public virtual Section SectionType
        {
            get { return sectionType; }
            set { SetValue<Section>("SectionType", ref sectionType, value); }
        }

        public virtual Branch Branch
        {
            get { return branch; }
            set { SetValue<Branch>("Branch", ref branch, value);}
        }

        public virtual string Name
        {
            get { return name; }
            set { SetValue<string>("Name", ref name, value); }
        }

        /// <summary>
        /// اسم المستودع باللغة الإنكليزية
        /// </summary>
        [Display(Name = "الأسم الأجنبي: ", ShortName = "الاسم الأجنبي", Order = 0)]
        public virtual string EngName
        {
            get { return engName; }
            set { SetValue<string>("EngName", ref engName, value); }
        }

        public virtual string Abbreviation
        {
            get { return abbreviation; }
            set { SetValue<string>("Abbreviation", ref abbreviation, value); }
        }

        /// <summary>
        /// ملاحظات
        /// </summary>
        [Display(Name = "ملاحظات: ", ShortName = "ملاحظات", Order = 0)]
        public virtual string Notes
        {
            get { return notes; }
            set { SetValue<string>("Notes", ref notes, value); }
        }

        /// <summary>
        /// الفرع الذي يتبع له المستودع الحالي
        /// </summary>
        [Display(Name = "الفرع: ", ShortName = "الفرع: ", Order = 0)]
        public virtual StorageSection Parent
        {
            get { return parent; }
            set { SetValue<StorageSection>("Parent", ref parent, value); }
        }

        public override bool Equals(object obj)
        {
            return ((StorageSection)obj).StorageSectionID == this.StorageSectionID;
        }
    }
}
